package com.cyj.dream.core.constant.pagemodel;

import com.cyj.dream.core.constant.enums.ResultCode;

/**
 * @Description: 封装响应返回
 * @BelongsProject: DreamChardonnay
 * @BelongsPackage: com.cyj.dream.core.constant.pagemodel
 * @Author: ChenYongJia
 * @CreateTime: 2021-09-26 10:29
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
public class Response<T> {

    private int code;
    private String message;
    private T data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean getOk() {
        if (code == ResultCode.SUCCESS200.code()) {
            return true;
        }
        return false;
    }

}